import type { FetchDataWrapper } from './wrapper';

interface ClusterMetrics {
  cpu_total: number;
  cpu_used: number;
  memory_total: number;
  memory_used: number;
  gpu_total: number;
  gpu_used: number;
  storage_total: number;
  storage_used: number;
  clusters: {
    id: string;
    name: string;
    address: string;
    cluster_type: string; // 假设只有 'cloud' 或 'edge'
    health_status: boolean;
    last_heartbeat: number; // Unix 时间戳
    cpu_total: number;
    cpu_used: number;
    memory_total: number;
    memory_used: number;
    gpu_total: number;
    gpu_used: number;
    storage_total: number;
    storage_used: number;
    task_num: number;
  }[];
}

export interface DataResource {
  name: string;
  cputotal: number;
  cpuuse: number;
  gpuuse: number;
  gputotal: number;
  diskuse: number;
  disktotal: number;
  memuse: number;
  memtotal: number;
  task: string;
  id: string;
  status: boolean;
  cluster_type: string;
  cluster_region: string;
}

export type ClusterMetricsFetchData = FetchDataWrapper<ClusterMetrics>;
